package by.twouexplorer;

import java.io.File;
import java.util.Date;

import android.text.format.DateFormat;

public class MetaData {
	
	private File path;
	private String name;
	private long size;
	private Date lastModified;
	
	public MetaData(){ //default constructor
		path=new File("");
		name=new String("");
		size=0;	
		lastModified=new Date();
	}
	
	public MetaData(String file){ //constructor with parameters
		path=new File(file);
		if(file.equals(TwoUExplorerMain.upperLevel)) name = new String(file);
		else name=new String(path.getName());
		size=0;
		lastModified=new Date();
	}
	
	public MetaData(File path, String name, long size, Date lastModified){ //Copy constructor
		this.path=path;
		this.name=name;
		this.size=size;
		this.lastModified=lastModified;
	}
	
	public MetaData(String file, long fileSize, double milliseconds){
		path=new File(file);
		name=new String(path.getName());
		size=fileSize;
		lastModified=new Date((long)milliseconds);						
	}
	
	//--------Getters and setters-----
	public File getFile() {
        return path;
	}
	
	public void setFile(File path) {
		this.path = path;
	}
	
	public String getPath(){
		return path.getAbsolutePath();
	}

	public String getName() {
        return name;
	}
	public void setName(String name) {
        this.name = name;
	}

	public long getSize() {
        return size;
	}

	public void setSize(long size) {
        this.size = size;
	}

	public Date getLastModified() {
        return lastModified;
	}

	public void setLastModified(Date lastModified) {
        this.lastModified = lastModified;
	}
	
	
	
}
